package com.ifyyf.service;

import com.ifyyf.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;

/**
 * @Author if
 * @Description: mapping注解的url是指向对应服务的接口url
 * @Date 2021-08-25 下午 10:30
 */
//指定负载均衡的服务名称，并添加服务降级配置类的class
@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT",fallbackFactory = DeptClientServiceFallbackFactory.class)
@Component
public interface DeptClintService {

    @GetMapping("/dept/getAll")
    List<Dept> queryAll();

    @GetMapping("/dept/get/{deptno}")
    Dept queryById(@PathVariable("deptno")Long deptno);
}
